import logging as log
import yaml


class ConfigUtil:
    def __init__(self, config_file):
        self.config_file = config_file
        self.config = {}

    def read_config(self):
        """
        Reads the config file and returns the config object
        """
        if self.config:
            return self.config
        config_file = self.config_file
        with open(config_file, 'r') as file:
            config = yaml.safe_load(file)
        self.config = config
        return config
